///*
// * Copyright (c) 2006-2020, RT-Thread Development Team
// *
// * SPDX-License-Identifier: Apache-2.0
// *
// * Change Logs:
// * Date           Author       Notes
// * 2021-03-16     78677       the first version
// */
//#include "main.h"
//
//
//#define PWM_DEV_NAME        "t5pwm"  /* PWM设备名称 */
//#define PWM_DEV_CHANNEL     1       /* PWM通道 */
//struct rt_device_pwm *pwm_dev;      /* PWM设备句柄 */
//ALIGN(RT_ALIGN_SIZE)
//static uint8_t PWM_Thread_Stack[1024];
//static void PWM_Thread_Entry(void *para);
//static struct rt_thread pwm_thread;
//
//rt_uint32_t period, pulse;
//
//
//void Pwm_Init(void){
//
//    period = 1000;    /* 周期为0.5ms，单位为纳秒ns */
//    pulse = 0;          /* PWM脉冲宽度值，单位为纳秒ns */
//    pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
//    RT_ASSERT(pwm_dev != RT_NULL);
//    /* 设置PWM周期和脉冲宽度 */
//    rt_pwm_set(pwm_dev, PWM_DEV_CHANNEL, period, pulse);
//    /* 使能设备 */
//    rt_pwm_enable(pwm_dev, PWM_DEV_CHANNEL);
//}
//
//static void PWM_Thread_Entry(void *para){
//    Pwm_Init();
//    while(1){
//        for (int var = 0; var < period; var += 100) {
//            rt_pwm_set(pwm_dev, PWM_DEV_CHANNEL, period, var);
//            rt_thread_mdelay(1000);
//        }
//    }
//}
//
//int Pwm_Thread_Init(void){
//
//    rt_thread_init(&pwm_thread, "pwm_thread", PWM_Thread_Entry, RT_NULL,
//            &PWM_Thread_Stack[0], sizeof(PWM_Thread_Stack), 10, 10);
//
//    rt_thread_startup(&pwm_thread);
//    return 0;
//}
//
//
////INIT_APP_EXPORT(Pwm_Thread_Init);
//
//
//
//
//
//
//
//
//
//
//
//
//
